

import React, { Component } from "react";

import { CSSTransition } from "react-transition-group";



export default class Transform extends Component{
    constructor(props) {
        super(props);
        this.state = {
            showText: true
        }
        this.changeShow = this.changeShow.bind(this);
    }

    changeShow(){
        this.setState({
            showText: !this.state.showText
        })
    }

    render() {
        return (
            <div>
                <button onClick={this.changeShow}>显示</button>
                <div className={this.state.showText ? 'show' : 'hidden'}>内容内容内容</div>

                <CSSTransition
                    in={this.state.showText}
                    timeout={2000}
                    unmountOnExit
                    classNames="box-text"
                >
                    <div>插件动画内容</div>
                </CSSTransition>
            </div>
        )
    }

}

